package com.hongdee.help.coupon.controller;


import com.hongdee.help.coupon.service.ITCouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * 优惠券相关帮助功能
 */
@RestController
@RequestMapping("/help/coupon")
public class TCouponController {

    @Autowired
    private ITCouponService couponService;

    @RequestMapping("/update/status")
    @ResponseBody
    public Map updateStatus(@RequestParam(name = "uid", defaultValue = "") String uid,
                            @RequestParam(name = "token", defaultValue = "") String token,
                            @RequestParam(name = "activityId", defaultValue = "") String activityId,
                            @RequestParam(name = "plateNum", defaultValue = "") String plateNum,
                            @RequestParam(name = "companyId", defaultValue = "") String companyId) throws Exception {
        Map map=new HashMap();
        couponService.updCouponStatus(plateNum,companyId,activityId);
        map.put("success","true");
        map.put("msg","更新指定活动的"+plateNum+"优惠券打印状态完成!!");
        return map;
    }
}
